home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3g / fnmatch.z / fnmatch
Encoding:
Text File  |  2002-10-03  |  5.5 KB  |  132 lines

  1.  
  2.  
  3.  
  4. ffffnnnnmmmmaaaattttcccchhhh((((3333GGGG))))                                                        ffffnnnnmmmmaaaattttcccchhhh((((3333GGGG))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      _ffff_nnnn_mmmm_aaaa_tttt_cccc_hhhh - match filename or pathname
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ffff_nnnn_mmmm_aaaa_tttt_cccc_hhhh_...._hhhh_>>>>
  13.      _iiii_nnnn_tttt _ffff_nnnn_mmmm_aaaa_tttt_cccc_hhhh _((((_cccc_oooo_nnnn_ssss_tttt _cccc_hhhh_aaaa_rrrr _****_pppp_aaaa_tttt_tttt_eeee_rrrr_nnnn_,,,, _cccc_oooo_nnnn_ssss_tttt _cccc_hhhh_aaaa_rrrr _****_ssss_tttt_rrrr_iiii_nnnn_gggg_,,,, _iiii_nnnn_tttt _ffff_llll_aaaa_gggg_ssss_))))_;;;;
  14.  
  15. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  16.      _ffff_nnnn_mmmm_aaaa_tttt_cccc_hhhh compares the string specified by the _s_t_r_i_n_g argument against the
  17.      pattern specified by the _p_a_t_t_e_r_n argument.
  18.  
  19.      The _f_l_a_g_s argument modifies the interpretation of _p_a_t_t_e_r_n and _s_t_r_i_n_g.  It
  20.      is the bitwise inclusive OR of zero or more of the flags defined in the
  21.      header _<<<<_ffff_nnnn_mmmm_aaaa_tttt_cccc_hhhh_...._hhhh_>>>>.  If the FNM_PATHNAME flag is set in _f_l_a_g_s, then a
  22.      slash character in _s_t_r_i_n_g will be explicitly matched by a slash in
  23.      _p_a_t_t_e_r_n; it will not be matched by either the asterisk or question-mark
  24.      special characters, nor by a bracket expression.  If the FNM_PATHNAME
  25.      flag is not set, the slash character is treated as an ordinary character.
  26.  
  27.      A backslash (`_\\\\') is used as an escape character in pattern strings.  If
  28.      FNM_NOESCAPE is not set in _f_l_a_g_s, a backslash character (_\\\\) in _p_a_t_t_e_r_n
  29.      followed by any other character will match that second character in
  30.      _s_t_r_i_n_g.  In particular, (_\\\\_\\\\) will match a backslash in _s_t_r_i_n_g.  If
  31.      FNM_NOESCAPE is set, a backslash character will be treated as an ordinary
  32.      character.
  33.  
  34.      If FNM_PERIOD is set in _f_l_a_g_s, then a leading period in _s_t_r_i_n_g will match
  35.      a period in _p_a_t_t_e_r_n.  The location of ''leading'' is indicated by the
  36.      value of FNM_PATHNAME.
  37.  
  38.          If FNM_PATHNAME is set, a period is ''leading'' if it is the first
  39.          character if _s_t_r_i_n_g.
  40.  
  41.          If FNM_PATHNAME is not set, a period is ''leading'' only if it is the
  42.          first character of _s_t_r_i_n_g.
  43.  
  44.      If FNM_PERIOD is not set, then no special restrictions are placed on
  45.      matching a period.
  46.  
  47. RRRREEEETTTTUUUURRRRNNNN VVVVAAAALLLLUUUUEEEE
  48.      If _s_t_r_i_n_g matches the pattern specified by _p_a_t_t_e_r_n, then _ffff_nnnn_mmmm_aaaa_tttt_cccc_hhhh returns
  49.      zero.  If there is no match, _ffff_nnnn_mmmm_aaaa_tttt_cccc_hhhh returns FNM_NOMATCH, which is
  50.      defined in the header _<<<<_ffff_nnnn_mmmm_aaaa_tttt_cccc_hhhh_...._hhhh_>>>>.  If an error occurs, _ffff_nnnn_mmmm_aaaa_tttt_cccc_hhhh returns
  51.      another non-zero value.
  52.  
  53. AAAAPPPPPPPPLLLLIIIICCCCAAAATTTTIIIIOOOONNNN UUUUSSSSAAAAGGGGEEEE
  54.      _ffff_nnnn_mmmm_aaaa_tttt_cccc_hhhh has two major uses.  It could be used by an application or
  55.      utility that needs to read a directory and apply a pattern against each
  56.      entry.  The _ffff_iiii_nnnn_dddd utility is an example of this.  It can also be used by
  57.      the _pppp_aaaa_xxxx utility to process its _p_a_t_t_e_r_n operands, or by applications that
  58.      need to match strings in a similar manner.
  59.  
  60.  
  61.                                                                         PPPPaaaaggggeeee 1111
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68. ffffnnnnmmmmaaaattttcccchhhh((((3333GGGG))))                                                        ffffnnnnmmmmaaaattttcccchhhh((((3333GGGG))))
  69.  
  70.  
  71.  
  72.      The name _ffff_nnnn_mmmm_aaaa_tttt_cccc_hhhh is intended to imply _ffff_iiii_llll_eeee_nnnn_aaaa_mmmm_eeee match, rather than
  73.      _pppp_aaaa_tttt_hhhh_nnnn_aaaa_mmmm_eeee match.  The default action of this function is to match
  74.      filenames, rather than pathnames, since it gives no special significance
  75.      to the slash character.  With the FNM_PATHNAME flag, _ffff_nnnn_mmmm_aaaa_tttt_cccc_hhhh does match
  76.      pathnames, but without tilde expansion, parameter expansion, or special
  77.      treatment for period at the end of a filename.
  78.  
  79. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  80.      glob(3g), wordexp(3g), _<<<<_ffff_nnnn_mmmm_aaaa_tttt_cccc_hhhh_...._hhhh_>>>>.
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.                                                                         PPPPaaaaggggeeee 2222
  128.  
  129.  
  130.  
  131.